Skip to content

Move TuiCode to Terminal.Gui 2.5 and MentalDesk.Tui 0.2.0 - #472

Merged
jamescrosswell merged 2 commits into
mainfrom
chore/tg-2-5
Oct 8, 2026
Merged

jamescrosswell merged 2 commits into
mainfrom
chore/tg-2-5

Conversation

@a-team-app

@a-team-app a-team-app Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

TuiCode now runs on Terminal.Gui 2.5.0 and MentalDesk.Tui 0.2.0, so it can take library releases again. Nothing should look or work differently: the four themes, a saved theme, saved keybindings, menus, help and the dirty marker all match a build of main side by side.

Closes #442

Notes for review:

  • themes.json is converted to 2.5's nested shape. It's the same themes, reformatted, so the diff is large.
  • TextView is obsolete in 2.5, which adds CS0618 warnings throughout, as Move TuiCode to Terminal.Gui 2.5 and MentalDesk.Tui 0.2.0 #442 expected.
  • 2.5 also broke tab headers: after a title changed (the ● dirty marker), the next tab's header overlapped it. PaneTabs.ShowTitle fixes it for editor and diff tabs, and EditorTabDirtyTests caught it.
  • Bump MentalDesk.Tui and Terminal.Gui #440 (Dependabot) becomes redundant once this merges.

a-team try tuicode 472

TG 2.5 replaces ConfigurationManager with TuiConfigurationBuilder, so
DefaultSettingsService loads the bundled themes through
TuiConfigurationBuilder.Shared, and themes.json is converted to the
nested shape 2.5 requires (it skips the old one with only a warning).
A saved {"Theme": ...} file and the keybindings file load unchanged.

Two runtime changes needed fixing:
- TextView.Text is no longer virtual, so EditorTextView hides it.
- A tab header measured its new title against its old size constraint,
  so neighbouring headers overlapped after a title change (the dirty
  marker). PaneTabs.ShowTitle sets the header's text and clears the
  constraint before re-measuring; editor and diff tabs both use it.

TerminalGuiInternalsTests checks that every [UnsafeAccessor] and
reflected field still finds its TG member, so a rename fails a test
rather than an edit. TextView.Drawing.cs in 2.5 still walks to EOF and
its draw logic is unchanged, so the bounded copy stays. Esc still
doesn't quit after a theme switch, now covered by a test.

Closes #442

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jamescrosswell

Copy link
Copy Markdown
Contributor

Why are you not addressing the CI issues here?

@jamescrosswell

Copy link
Copy Markdown
Contributor

Still waiting for you to pick this up.

Attached to a terminal, TG 2.5's ANSI driver sizes itself from it rather
than defaulting to 80x25, so on Windows CI the gutter, tall-file scrollbar
and command-line position tests drew into the console's own size. Pinning
80x25 makes them independent of the console. Reproduced on macOS by
running the tests under a pty.

Closes #442

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@a-team-app

a-team-app Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, both comments went unanswered: an earlier run worked on a fix but never pushed it, and that fix was wrong anyway.

Fixed in 38c892c. On TG 2.5 the ANSI driver takes its size from the console it's attached to, so on Windows CI four host tests drew at the console's size, not 80×25. They now pin their size. I reproduced the failure on macOS by running them under a pty; they fail there before this change and pass after it. CI is running again, and I'll mark this ready once it's green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move TuiCode to Terminal.Gui 2.5 and MentalDesk.Tui 0.2.0

1 participant